Find a Conic from Five Poins

A conic is a slice through a double cone which can result in a circle, ellipse, parabola, hyperbola, line, double line or point. Previously we have given the general equation, which is $$ax^{2}+bxy+cy^{2}+dx+ey+f=0 \tag{1} \label{1}.$$ When viewed from the perspective of the $6$ coefficients, $(a,b,c,d,e,f)$, it is a linear equation and and we can arrange it so that coefficient $f$ is equal to $1$ on the right hand side. Thus we can write a system of equations if we use $5$ points, $(p_{1},q_{1})\ldots(p_{5},q_{5})$ and the general conic equation. The determinant of this system results in a single system equation using the coefficients of $5$ points. In general, it is equation $\eqref{1}$, and the coefficients would be defined after the determinant is expanded from $\eqref{2}$. $$\left|\begin{array}{cccccc} x^{2} & xy & y^{2} & x & y & 1\\ p_{1}^{2} & p_{1}q_{1} & q_{1}^{2} & p_{1} & q_{1} & 1\\ p_{2}^{2} & p_{2}q_{2} & q_{2}^{2} & p_{2} & q_{2} & 1\\ p_{3}^{2} & p_{3}q_{3} & q_{3}^{2} & p_{3} & q_{3} & 1\\ p_{4}^{2} & p_{4}q_{4} & q_{4}^{2} & p_{4} & q_{4} & 1\\ p_{5}^{2} & p_{5}q_{5} & q_{5}^{2} & p_{5} & q_{5} & 1 \end{array}\right|=0 \tag{2} \label{2}$$ Done this way, the “coefficient” $f$ can be moved to the right side. $$ax^{2}+bxy+cy^{2}+dx+ey=-f.$$ Then we can divide through by $-f$ to get $$-\frac{a}{f}x^{2}-\frac{b}{f}xy-\frac{c}{f}y^{2}-\frac{d}{f}x-\frac{e}{f}y=1$$ Also, since we do not yet know what the constants are we can replace them with $$a^{\prime}x^{2}+b^{\prime}xy+c^{\prime}y^{2}+d^{\prime}x+e^{\prime}y=1.$$ Now the five points that we have can be arranged as a linear system, and solved by Gaussian elimination. $$\left[\begin{array}{ccccc} p_{1}^{2} & p_{1}q_{1} & q_{1}^{2} & p_{1} & q_{1}\\ p_{2}^{2} & p_{2}q_{2} & q_{2}^{2} & p_{2} & q_{2}\\ p_{3}^{2} & p_{3}q_{3} & q_{3}^{2} & p_{3} & q_{3}\\ p_{4}^{2} & p_{4}q_{4} & q_{4}^{2} & p_{4} & q_{4}\\ p_{5}^{2} & p_{5}q_{5} & q_{5}^{2} & p_{5} & q_{5} \end{array}\right]=\left[\begin{array}{c} 1\\ 1\\ 1\\ 1\\ 1 \end{array}\right]$$

ConicFrom5Pts.png
Figure 1: Hyperbola made from 5 points.
Example: Let's pick five random, but semi-nice points. $$\begin{aligned}A= & (1,1)\\ B= & (3.5)\\ C= & (5,4)\\ D= & (3,3)\\ F= & (5,2) \end{aligned} $$ Now we arrange their coordinates into the prescribed matrix. $$M=\left(\begin{array}{rrrrrr} 1 & 1 & 1 & 1 & 1 & 1\\ 9 & 15 & 25 & 3 & 5 & 1\\ 25 & 20 & 16 & 5 & 4 & 1\\ 9 & 9 & 9 & 3 & 3 & 1\\ 25 & 10 & 4 & 5 & 2 & 1 \end{array}\right)$$ Use a CAS (or write your own python code) to row reduce $M$. $$m1=\left(\begin{array}{rrrrrr} 1 & 0 & 0 & 0 & 0 & \frac{13}{9}\\ 0 & 1 & 0 & 0 & 0 & -\frac{8}{9}\\ 0 & 0 & 1 & 0 & 0 & -\frac{8}{9}\\ 0 & 0 & 0 & 1 & 0 & -\frac{76}{9}\\ 0 & 0 & 0 & 0 & 1 & \frac{88}{9} \end{array}\right)$$ The right side of $m1$ represents the coefficients of the general conic. $$Ax^{2}+Bxy+Cy^{2}+Dx+Ey=1$$ $$\frac{13}{9}x^{2}-\frac{8}{9}xy-\frac{8}{9}y^{2}-\frac{76}{9}x+\frac{88}{9}y=1$$